'use strict';
const dayjs = require("dayjs");
module.exports = app => {
  const { STRING, INTEGER,DATE } = app.Sequelize;
    return app.model.define(
      'hybrid',
      {
          id: {type: INTEGER, primaryKey: true, autoIncrement: true},
            beef: {type: INTEGER, allowNull: false, comment: '牛只id'},
            estdate: {type:DATE, allowNull: false, comment: '发情日期'},
            mater: {type: INTEGER, allowNull: false, comment: '与配牛只'},
            hydate: {type:DATE, allowNull: false, comment: '配种日期'},
            hytype: {type: STRING(50), allowNull: false, comment: '配种方式'},
            hoperator: {type: STRING(20), allowNull: false, comment: '配种员'},
            firstpreg: {type:DATE, allowNull: false, comment: '第一次妊检时间'},
            firstresult: {type: STRING(50), allowNull: false, comment: '第一次妊检结果'},
            foperator: {type: STRING(20), allowNull: false, comment: '第一次操作员'},
            secondpreg: {type:DATE, allowNull: false, comment: '第二次妊检时间'},
            secondresult: {type: STRING(50), allowNull: false, comment: '第二次妊检结果'},
            soperator: {type: STRING(20), allowNull: false, comment: '第二次操作员'},
            remark: {type: STRING(100), allowNull: false, comment: '备注'},
            version: {type: INTEGER, allowNull: false, defaultValue: 1},
            is_deleted: {type: INTEGER, allowNull: false, defaultValue: 0},
      },
      {
          tableName: 'hybrid',
          timestamps: true, // 启用时间戳(createdAt, updatedAt)
          updatedAt: false, // 不想要 updatedAt
          createdAt: false, // 想要  createdAt 但是希望名称叫做 created_at
      }
  );
};

